package com.onlinemovies.repository.extension;

import java.io.Serializable;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.onlinemovies.entity.BookingDetails;
import com.onlinemovies.entity.HallDetails;
import com.onlinemovies.entity.User;
import com.onlinemovies.repository.AbstractRepository;
@Repository("BookDetailsRepositary")
public class BookDetailsRepositary  extends AbstractRepository<BookingDetails> implements Serializable{

	@SuppressWarnings("unchecked")
	public List<BookingDetails> getAll(User user) {
	        return entityManager
	        		.createQuery("SELECT h FROM BookingDetails h where h.userDetails.id=?1")
	        		.setParameter(1, user.getId())
	        		.getResultList();
	    }
}
